Skip to content

throw RangeError when skippedElements > Number.MAX_SAFE_INTEGER#15

Merged
michaelficarra merged 1 commit into
mainfrom
throw-for-large-skip
May 29, 2026
Merged

throw RangeError when skippedElements > Number.MAX_SAFE_INTEGER#15
michaelficarra merged 1 commit into
mainfrom
throw-for-large-skip

Conversation

@michaelficarra

Copy link
Copy Markdown
Member

Fixes #12.

michaelficarra added a commit to tc39/test262 that referenced this pull request May 29, 2026
@michaelficarra michaelficarra merged commit 57a609c into main May 29, 2026
2 checks passed
@michaelficarra michaelficarra deleted the throw-for-large-skip branch May 29, 2026 21:58
ljharb added a commit to es-shims/iterator-helpers that referenced this pull request Jun 5, 2026
…* 53 - 1

Per tc39/proposal-iterator-includes#15,
a finite `skippedElements` greater than 2 ** 53 - 1 must throw a RangeError
(closing the receiver)
+Infinity/-Infinity are unaffected since they are not finite.

See tc39/proposal-iterator-includes#15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Throw if toSkip > Number.MAX_SAFE_INTEGER

1 participant